<?php echo validation_errors('<p class="error">', '</p>'); ?>
<?php 
$attributes = array('class' => 'form_input', 'id' => '');
$hidden = array('id'=>$model['id']);
echo form_open('',$attributes,$hidden) ?>
<table class="tbl form">
<tbody>
<tr>
	<td colspan="4">{{helper:lang line='project:title'}}</td>
<tr>
	<td  colspan="4" class="tl"><?php $data = array('name'=>'title','id'=>'title','value'=> $model['title'],'maxlength'=>255,'class'=>'txt medium');
		echo form_input($data);?></td>
</tr>
<tr>
	<td width="100">{{helper:lang line='project:date_start'}}</td>
	<td width="110"><input type="text" name="date_start" class="date_start from" value="{{helper:date format = 'd-m-Y' timestamp = model:date_start}}" /></td>
	<td width="100">{{helper:lang line='project:date_end'}}</td>
	<td><input  type="text" name="date_end" class="date_end to" value="{{helper:date format = 'd-m-Y' timestamp = model:date_end}}" /></td>
</tr>
<tr>
	<td  colspan="4">{{helper:lang line='project:description'}}</td>
</tr>
<tr>
	<td  colspan="4">
	<?php $data = array('name'=>'description','id'=>'description','value'=> $model['description'],'class'=>'editor large', 'rows'=>10,'cols'=>80);
	echo form_textarea($data) ?>
	</td>
</tr>

</tbody>
</table>
{{ theme:partial name="_form_button" }}	
<?php echo form_close()?>

<script type="text/javascript">
CKEDITOR.config.toolbar = [
   ['Styles','Format','Font','FontSize'],
   //'/',
   ['Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print'],
   ['NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']
   //['Image','Table','-','Link','Flash','Smiley','TextColor','BGColor','Source']
] ;
CKEDITOR.replaceClass = 'editor';

$(function() {
    $( "input.from" ).datepicker({
	dateFormat:"dd-mm-yy",
    defaultDate: "+1w",
    changeMonth: true,
    numberOfMonths: 3,
    onClose: function( selectedDate ) {
      $( "input.to" ).datepicker( "option", "minDate", selectedDate );
    }
    });
	
    $( "input.to" ).datepicker({
	dateFormat:"dd-mm-yy",
      defaultDate: "+1w",
      changeMonth: true,
      numberOfMonths: 3,
      onClose: function( selectedDate ) {
        $( "input.from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
</script>